-
Notifications
You must be signed in to change notification settings - Fork 378
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add attempt event for sessionstate #5237
base: master
Are you sure you want to change the base?
Add attempt event for sessionstate #5237
Conversation
var list = new List<SessionState>(); | ||
var list = new List<SessionState>(players.Length); | ||
var ev = new GetSessionStateAttempt(session); | ||
_entityManager.EventBus.RaiseEvent(EventSource.Local, ref ev); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This isn't really simulation logic so using EventBus here doesn't really make a lot of sense. Just use a regular C# event?
foreach (var client in players) | ||
{ | ||
var info = new SessionState | ||
{ | ||
UserId = client.UserId, | ||
Name = client.Name, | ||
Name = ev.Cancelled ? string.Empty : client.Name, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Isn't this just the player name? It doesn't seem very useful to try to hide this info when player names are just public from the auth API anyways.
Status = client.Status, | ||
Ping = client.Channel!.Ping | ||
Ping = client.Channel.Ping, | ||
ControlledEntity = EntManager.GetNetEntity(client.AttachedEntity), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Exposing the controlled entity seems very powerful, what use does this have for players?
No description provided.